from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/user/<name>')
def find_name(name):
    users = [
        {"name": "Tom", "age": "18", "sex": 1},
        {"name": "Coral", "age": "17", "sex": 0},
        {"name": "Kate", "age": "18", "sex": 0}
    ]
    for username in users:
        user_name = username.get("name").lower()
        if user_name == name.lower():
            return jsonify(username)
    return jsonify({"error": "Can not found!"})

if __name__ == '__main__':
    app.run()
